import { defineConfig } from 'vite'
import { viteSingleFile } from "vite-plugin-singlefile"
import viteCompression from 'vite-plugin-compression'

export default defineConfig({
    plugins: [viteSingleFile(), viteCompression({ algorithm: 'gzip' })],
    build: {
        target: 'es2015',
        assetsInlineLimit: Infinity,
        cssCodeSplit: false,
        minify: 'terser',
        terserOptions: {
            compress: {
                drop_console: false,
                drop_debugger: false,
            },
            format: {
                comments: false,
            },
        },
        rollupOptions: {
            output: {
                inlineDynamicImports: true,
                manualChunks: undefined,
            },
        },
    },
})